package com.itheima.springbootdemo02.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.NestedConfigurationProperty;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

@Component
@ConfigurationProperties(prefix = "spring.boot.demo02")
public class UserConfigProperties {
    //用来代表 了  int double float 字符串 ....基本类型
    private String username;

    private Map<String,Object> girlFriend;

    private Friend[] friends;

    private String[] hobbies;

    private List<String> habits;
    @NestedConfigurationProperty
    private HomeTown homeTown;

    public Friend[] getFriends() {
        return friends;
    }

    public void setFriends(Friend[] friends) {
        this.friends = friends;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public Map<String, Object> getGirlFriend() {
        return girlFriend;
    }

    public void setGirlFriend(Map<String, Object> girlFriend) {
        this.girlFriend = girlFriend;
    }

    public String[] getHobbies() {
        return hobbies;
    }

    public void setHobbies(String[] hobbies) {
        this.hobbies = hobbies;
    }

    public List<String> getHabits() {
        return habits;
    }

    public void setHabits(List<String> habits) {
        this.habits = habits;
    }

    public HomeTown getHomeTown() {
        return homeTown;
    }

    public void setHomeTown(HomeTown homeTown) {
        this.homeTown = homeTown;
    }
}
